package com.smartlbs.socket;

import java.util.Set;

import javax.websocket.Endpoint;
import javax.websocket.server.ServerApplicationConfig;
import javax.websocket.server.ServerEndpointConfig;

import org.apache.log4j.Logger;

public class SocketServerConfig implements ServerApplicationConfig {

	private Logger log = Logger.getLogger(SocketServerConfig.class);  
    /** 
     * 基于注解的实现方式,<br /> 
     * classess 中的类是实现了有@ServerEndpoint标注的类 
     */  
    @Override  
    public Set<Class<?>> getAnnotatedEndpointClasses(Set<Class<?>> classes) {  
        log.info("服务器启动...");  
        for (Class<?> clazz : classes) {  
            log.info("加载的websocket服务类:" + clazz.getName());  
        }  
        return classes;  
    }  
  
    /** 
     * 基于接口的实现方式 
     */  
    @Override  
    public Set<ServerEndpointConfig> getEndpointConfigs(Set<Class<? extends Endpoint>> arg0) {  
    	log.info("服务器启动接口...");
    	return null;  
    }  
}
